﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Domain
{
    /// <summary>
    /// 订单操作记录表
    /// </summary>
    public class OrderOperation
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 关联的已发货订单ID
        /// </summary>
        [Required]
        public int ShippedOrderId { get; set; }

        /// <summary>
        /// 操作序号
        /// </summary>
        public int OperationSequence { get; set; }

        /// <summary>
        /// 操作人
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string Operator { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OperationTime { get; set; }

        /// <summary>
        /// 操作类型 (创建、修改、发货、收费等)
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string OperationType { get; set; }

        /// <summary>
        /// 操作描述
        /// </summary>
        [Required]
        [MaxLength(500)]
        public string OperationDescription { get; set; }

        /// <summary>
        /// 操作前状态
        /// </summary>
        [MaxLength(100)]
        public string BeforeStatus { get; set; }

        /// <summary>
        /// 操作后状态
        /// </summary>
        [MaxLength(100)]
        public string AfterStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(500)]
        public string Remark { get; set; }

        // 导航属性
        /// <summary>
        /// 关联的已发货订单
        /// </summary>
        [ForeignKey("ShippedOrderId")]
        public virtual ShippedOrder ShippedOrder { get; set; }
    }

}
